<template>
  <div class="user-wrapper">
    <div class="user-title">
      <van-button
        class="btn-back"
        icon="arrow-left"
        :to="{ name: 'user' }" />
      {{ $t('User.aboutus') }}
    </div>
    <img class="app-logo" src="../../assets/images/tcb-logo.png" alt="">
    <h2 class="app-name">台词宝</h2>
    <van-cell-group>
      <van-cell
        :title="$t('User.new_version')"
        :value="`V${curVersion}`"
        @click="showPopUp=true"
        is-link />
      <van-cell
        :title="$t('User.agreement')"
        is-link />
    </van-cell-group>
    <div class="copyright" v-html="$t('User.copyright')"></div>
    <van-dialog
      :title="$t('User.new_version_tip')"
      v-model="showPopUp"
      className="update-tip"
      :confirmButtonText="$t('User.version_upgrade')"
      :cancelButtonText="$t('User.cancel')"
      messageAlign="left"
      show-cancel-button
      @confirm="upgrade"
    >
      <h2 class="update-title">{{ $t('User.version_upgrade_tip', [curVersion])}}</h2>
      <div class="detail">{{ upgradeMsg }}</div>
    </van-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      curVersion: '2.0',
      showPopUp: false,
      upgradeMsg: '1、增加提词横屏功能 2、界面重新设计焕然一新 3、修复已知BUG',
    };
  },
  methods: {
    upgrade() {

    }
  }
};
</script>

<style lang="less" scoped>
  .app-logo{
    width: 130px;
    height: 130px;
    display: block;
    border-radius: 10px;
    margin: 100px auto 20px;
    overflow: hidden;
  }
  .app-name{
    text-align: center;
    font-size:@font-size-md;
  }
  .van-cell-group{margin-top: 70px;}
  .van-cell{
    height: 90px;
    align-items: center;
    margin-bottom: 2px;
    font-family: 'PingFang-SC-Regular';
    font-size:@font-size-md;
  }
  .van-cell__value{
    font-weight:bold;
    color: #333;
  }
  .copyright{
    line-height: 40px;
    text-align: center;
    font-family: 'PingFang-SC-Regular';
    font-size:@font-size-sm;
    position: fixed;
    bottom: 30px;
    left: 50%;
    width: 750px;
    transform: translate(-375px, 0);
    color: #999;
  }
  .update-tip{
    /deep/ .van-dialog__header{
      padding: 30px 50px;
      text-align: left;
    }
    /deep/ .van-dialog__content{
      background: #F9F9F9;
      padding: 40px 50px;
      line-height:48px;
    }
  }
  .update-title{
    margin-bottom: 20px;
    font-size:@font-size-md;
    color: #666;
  }
  .detail{
    font-size: @font-size-sm;
    font-family: 'PingFang-SC-Regular';
    white-space: pre-line;
  }
</style>
